<template>
  <div class="user">欢迎，{{ this.user.username }}！</div>
</template>
<script>
export default {
  data() {
    return {
      user: null,
    };
  },
  created() {
    this.showSession();
  },
  methods: {
    showSession() {
      this.user = JSON.parse(window.sessionStorage.getItem("User"));
      console.log(this.user.username);
    },
  },
};
</script>
<style scoped></style>